package eu.webhib.frmwrk.service.intf;

import eu.webhib.frmwrk.domain.intf.ParentChildEntity;
import java.util.List;

/**
 * Service interface for managing the persistence state of entities with parent/child relationship
 * @param <T> type of parent/child related entity managed by this service interface
 */
public interface ParentChildService<T extends ParentChildEntity<T>> extends BaseService<T> {

   /**
    * Return all top level entities, the ones having no parents (null-parents)
    */
   List<T> getRootList();

   /**
    * Move an entity to a other parent. Handles also null-parents.
    * @param entityToChange the entity those parent relation is to be changed
    * @param newParent the new parent
    */
   // todo: remove
   void moveToNewParent(T entityToChange, T newParent);
}
